-- GENERATED SPELL FOR [Illidari Ravager] --


function spell0_22857(pUnit, Event) --@Cleave,n/a--
pUnit:FullCastSpellOnTarget(15496,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_22857', 621, 1)
end

function spell1_22857(pUnit, Event) --@Cutdown,n/a--
pUnit:FullCastSpellOnTarget(32009,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_22857', 566, 1)
end

function spell2_22857(pUnit, Event) --@Demoralizing Shout,Self--
pUnit:FullCastSpellOnTarget(16244,pUnit)
pUnit:RegisterEvent('Sorts_22857', 30261, 1)
end

function Sorts_22857(pUnit, Event)
local choix_sorts_22857 = math.random(0, 2)
if choix_sorts_22857 == 0 then
pUnit:RegisterEvent('spell0_22857', 1, 1)
end
if choix_sorts_22857 == 1 then
pUnit:RegisterEvent('spell1_22857', 1, 1)
end
if choix_sorts_22857 == 2 then
pUnit:RegisterEvent('spell2_22857', 1, 1)
end
end

function mob22857_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_22857', math.random(1500, 3000), 1)
end

function mob22857_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob22857_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob22857_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(22857, 1, 'mob22857_Action')
RegisterUnitEvent(22857, 2, 'mob22857_Leave')
RegisterUnitEvent(22857, 3, 'mob22857_Kill')
RegisterUnitEvent(22857, 4, 'mob22857_Die')
